#pragma once
#include "PhysicsObjects.h"
#include "ParticleSystem.h"

class BasicThruster : public PhysicsBox
{
private:
	short Throttle;
	float Thrust;
	D3DXVECTOR3 ThrustVector;
	D3DXVECTOR3 Angles;
	D3DXVECTOR3 Offset;
	D3DXMATRIX RotationMatrix;
	bool IsActive;
	bool IsDestroyed;

	ThrusterEffect *MainTrail;

public:

	BasicThruster();
	BasicThruster(IDirect3DDevice9 *nDevice, D3DXVECTOR3 nPosition, D3DXVECTOR3 nVelocity, float nThrust);
	~BasicThruster();

	void SetOffset( D3DXVECTOR3 nOffset );
	D3DXVECTOR3 GetOffset( void );

	bool GetIsActive( void );
	bool GetIsDestroyed( void );

	D3DXVECTOR3 GetAngles( void );
	void SetSpawnVelocity(D3DXVECTOR3 nSpawnVelocity);

	void Activate( void );
	void Deactivate( void );

	void Destroy( void );

	void SetAngles(D3DXVECTOR3 nAngles);
	void SetAngles(float nX, float nY, float nZ);
	void SetWVPMatrix(const D3DXMATRIX &Matrix);
	void SetEyePosition(const D3DXVECTOR3 &nVector);

	void SetThrottle(short nThrottle);

	virtual void Render( void );
	virtual void Update( float dt );

	void SetPosition( D3DXVECTOR3 nPosition );

	bool CreateCube( D3DXVECTOR3 nHalfVector );
};